package zoz.cool.jahub.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import zoz.cool.jahub.domain.JahubUser;
import zoz.cool.jahub.service.JahubUserService;
import zoz.cool.jahub.mapper.JahubUserMapper;
import org.springframework.stereotype.Service;

/**
 * @author zhayongchun
 * @description 针对表【jahub_user(用户表)】的数据库操作Service实现
 * @createDate 2024-06-07 17:00:13
 */
@Service
public class JahubUserServiceImpl extends ServiceImpl<JahubUserMapper, JahubUser>
        implements JahubUserService {
    public JahubUser getUser(String key) {
        QueryWrapper<JahubUser> query = new QueryWrapper<>();
        query.eq("username", key);
        query.or().eq("email", key);
        query.or().eq("phone", key);
        return getOne(query);
    }
}
